package com.xsprite.managesys.service;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;

import com.alibaba.fastjson.JSONObject;
import com.xsprite.managesys.bean.ItemLog;
import com.xsprite.managesys.bean.LevelSection;
import com.xsprite.managesys.bean.LoginlogRecord;
import com.xsprite.managesys.bean.Player;
import com.xsprite.managesys.bean.PlayerInfoLog;
import com.xsprite.managesys.bean.PlayerLog;
import com.xsprite.managesys.bean.QueryRoleInfo;
import com.xsprite.managesys.bean.QueryServer;
import com.xsprite.managesys.dao.MyBatisDao;
import com.zhangzhang.util.Util;

import util.VersionUpdateUtil;

public class ServersDatabaseManager {
	
	private static ServersDatabaseManager instance;
	private List<QueryServer> serversList = new ArrayList<QueryServer>();
	private Map<Integer, QueryServer> serversMap = new HashMap<Integer, QueryServer>();
	private MyBatisDao batisDao = new MyBatisDao();
	
	public static ServersDatabaseManager getInstance(){
		if(instance == null){
			instance = new ServersDatabaseManager(); 
		}
		return instance;
	}

	private ServersDatabaseManager(){
		
	}
	
	public QueryServer getServerById(int id){
		return serversMap.get(id);
	}

	
	public List<QueryServer> getServersLsit(){
		return this.serversList;
	}
	
	public void loadServers(String clientServerPath, String dblistPath, String batisPath) throws Exception{
		SAXBuilder saxBuilder=new SAXBuilder(false);
		saxBuilder.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        saxBuilder.setExpandEntities(false);
        File file = new File(clientServerPath);
        Document doc = saxBuilder.build(file);
        Element root = doc.getRootElement();
        List<Element> connectServers = root.getChild("connect-servers").getChildren("connect-server");
        for(Element serverEle : connectServers){
        	QueryServer queryemailServer = new QueryServer();
        	queryemailServer.setServerId(Integer.parseInt(serverEle.getChild("server-id").getText()));
        	queryemailServer.setServerIp(serverEle.getChild("server-ip").getText());
        	queryemailServer.setServerPort(Integer.parseInt(serverEle.getChild("server-port").getText()));
        	serversList.add(queryemailServer);
        	serversMap.put(queryemailServer.getServerId(), queryemailServer);
        }
        
        File dblistFile = new File(dblistPath);
        Document dblistDoc = saxBuilder.build(dblistFile);
        Element dblistRoot = dblistDoc.getRootElement();
        List<Element> dbTags = dblistRoot.getChildren("dbtag");
        
        for(QueryServer queryemailServer : serversList){
        	int serverid = queryemailServer.getServerId();
        	for(Element dbTagEle : dbTags){
        		int thisTagId = Integer.parseInt(dbTagEle.getText());
        		if(thisTagId == serverid){
        			queryemailServer.setGameDBId(Integer.parseInt(dbTagEle.getAttribute("gameDBId").getValue()));
        			queryemailServer.setDataDBId(Integer.parseInt(dbTagEle.getAttribute("DataDBId").getValue()));
        			queryemailServer.setLogDBId(Integer.parseInt(dbTagEle.getAttribute("logDBId").getValue()));
        			queryemailServer.setServerName(dbTagEle.getAttribute("serverName").getValue());
        			break;
        		}
            }
        }
        batisDao.loadFactories(serversList, batisPath);
	}
	
	public QueryRoleInfo queryRoleInfo(int gameDbId, String playerName){
		return batisDao.queryRoleInfo(gameDbId, playerName);
	}
	
	public List<PlayerInfoLog> queryPlayerInfoLog(int serverid, int logDbid, String userid, PlayerInfoLog infoLog){
		return batisDao.queryPlayerInfoLog(serverid, logDbid, userid, infoLog);
	}
	
	public List<ItemLog> queryEmail(int serverid, int logDbid, String playerName, String toQueryTable, String userid){
		return batisDao.queryEmail(serverid, logDbid, playerName, toQueryTable, userid);
	}
	
	private List<Player> queryPlayers(int gameDbId){
		return batisDao.queryPlayers(gameDbId);
	}
	
	private List<Player> queryStasticPlayers(int gameDbId){
		return batisDao.queryStasticPlayers(gameDbId);
	}
	
	private List<LoginlogRecord> queryEverydayLogin(int logDbid, int dayCount){
		List<PlayerLog> playerLogs = new ArrayList<PlayerLog>();
		for(int i = 0; i < dayCount; i++){
			Calendar calendar = Calendar.getInstance();
			calendar.add(Calendar.DATE, i - dayCount + 1);
			Date targetDate = calendar.getTime();
			String targetYear = targetDate.getYear() % 100 + "";
			String targetMonth = (targetDate.getMonth() > 9 ? (targetDate.getMonth() + "" ): ("0" + targetDate.getMonth()));
			String targetDay = (targetDate.getDate() > 9 ? (targetDate.getDate() + "") : ("0" + targetDate.getDate()));
			PlayerLog playerLog = new PlayerLog();
			playerLog.setToqueryTable(targetYear + targetMonth + targetDay);
			playerLogs.add(playerLog);
		}
		return batisDao.queryEverydayLogin(logDbid, playerLogs);
	}
	
	public void queryPlayerLog(QueryServer server, long startTime, long endTime){
		
	}
	
	public void writeEverydayLoginToDisk(String basePath, List<QueryServer> servers, int dayCount) throws IOException{
		for(QueryServer server : servers){
			List<LoginlogRecord> records = queryEverydayLogin(server.getLogDBId(), dayCount);
			List<String> lines = getEverydayLogin(records);
			Util.writeLinesToFile(basePath + "/" + server.getServerName() + "_每日登录", lines, "UTF-8", false);
		}
	}
	
	public void writeStasticToDisk(String basePath, List<QueryServer> servers) throws IOException{
		for(QueryServer server : servers){
			List<Player> players = queryStasticPlayers(server.getGameDBId());
			List<String> lines = getStasticPlayers(players);
			Util.writeLinesToFile(basePath + "/" + server.getServerName(), lines, "UTF-8", false);
		}
	}
	
	public void writeRegisterPlayersToDisk(String basePath, List<QueryServer> servers, long startTime) throws Exception{
		int count = 0;
		for(QueryServer server : servers){
			List<Player> players = queryPlayers(server.getGameDBId());
			List<String> lines = getRegistPlayers(players, startTime, server.getServerName());
			if(count == 0){
				Util.writeLinesToFile(basePath, lines, "UTF-8", false);	
			} else {
				Util.writeLinesToFile(basePath, lines, "UTF-8", true);
			}
			count++;
		}
	}
	
	private List<String> getEverydayLogin(List<LoginlogRecord> records){
		List<String> result = new ArrayList<String>();
		StringBuffer sb = new StringBuffer();
		List<String> days = new ArrayList<String>();
		List<Integer> counts = new ArrayList<Integer>();
		
		for(LoginlogRecord record : records){
			days.add(record.getTime());
			counts.add(record.getLoginCount());
		}
		
		for(String day : days){
			sb.append(day + "\t");
		}
		result.add(sb.substring(0, sb.length() - 1));
		sb = new StringBuffer();
		for(Integer count : counts){
			sb.append(count + "\t");
		}
		result.add(sb.toString());
		return result;
	}
	
	private List<String> getStasticPlayers(List<Player> players){
		List<String> result = new ArrayList<String>();
		StringBuffer sb = new StringBuffer();
		result.add("本服共有" + players.size() + "个玩家");
		Map<LevelSection, List<Player>> playerLvMap = groupByLevelPeriod(players);
		for(LevelSection ls : playerLvMap.keySet()){
			result.add(ls.getStartLv() + "-->" + ls.getEndLv() + "的玩家有: " + playerLvMap.get(ls).size() + "人");
		}
		for(Player p : players){
			result.add(p.getRolename() + "\t" + p.getLevel() + "\t" + parseDate(p.getLogintime()));
		}
		return result;
	}
	
	
	private final int levelInterval = 5;
	
	private Map<LevelSection, List<Player>> groupByLevelPeriod(List<Player> players){
		List<LevelSection> sections = new ArrayList<LevelSection>();
		for(int i = 0; i < 20; i++){
			LevelSection section = new LevelSection(i * levelInterval + 1, (i + 1) * levelInterval);
			sections.add(section);
		}
		Map<LevelSection, List<Player>> levelAndPlayers = new LinkedHashMap<LevelSection, List<Player>>();
		for(LevelSection section : sections){
			levelAndPlayers.put(section, new ArrayList<Player>());
		}
		
		for(Player player : players){
			for(LevelSection ls : levelAndPlayers.keySet()){
				if(ls.isInLvSection(player.getLevel())){
					levelAndPlayers.get(ls).add(player);
					break;
				}
			}
		}
		return levelAndPlayers;
	}
	
	private List<String> getRegistPlayers(List<Player> players, long startTime, String serverName) throws Exception{
		List<String> result = new ArrayList<String>();
		StringBuffer sb = new StringBuffer();
		for(Player player : players){
			com.alibaba.fastjson.JSONObject jsonObj = JSONObject.parseObject(VersionUpdateUtil.dateLoad(player.getData()));
			long time = jsonObj.getLong("createTime");
			if(time <= startTime){
				continue;
			}
			sb.append(player.getRoleid() + "\t" + player.getRolename() + "\t" + serverName);
			sb.append("\t" + parseDate(time));
			result.add(sb.toString());
			sb.delete(0,sb.length());
		}
		return result;
	}
	
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	private String parseDate(long time){
		String result = sdf.format(new Date(time));
		return result;
	}
	
	public static void main(String[] args) throws Exception {
		String data = "#20140923#H8KLCAAAAAAAAADDrV3Dm3LDmzgSw70XPXvCpnAhQDJvdixnHDvCtjdWw6Zawq4UI1ESYsKaVHhxwqLCpMO8AVt7ecOafcObf8KYfcOZX8Kaw5nDj8OYbgDCpChZTijChnNbKU5JbFzCmsOAw6lGwqMbwqDDgA/CvWDCmMKrW8KVH8OHw6PCpMO3w6hDbzhNw6LDicO7wql6wpbDhMOhHBM4I8K9Rz1BCMOpw53DrWF2w7FUBcOxZMKgbsOCw54jAknDgWjCtD/Di1VewoxCLMO/CipCBhRNwoo0wpjDgDXDm8Orwo3Cg8OcJBbDscKow7fCiMOaWnnCnsKqV0Uewp4VNzoTw5IOwoIswqzDksKRXRjCjwrCncKpYsOLYjbCncOrw68sT20DJmHCnEMbWQ/CrsOvwrXChC01wqVqCxXCtjFMIsKLNAwOworDucKRwppMw7PCqjXCkMK2wpxgWC/DiDwYXsO3HknDj8OxaUnCvsKEPgBzR8OTwrXDnjHCvF/DsMOWw7TDoBUUwpzDqcK6w5DCvzfChcKaPQvDnsOpUgIydULDlnvDtMODwoclwozCsCzChRJ7w5BNw7zDpMO6w5PCgU/DncO8XMKNQcKQwoPDuQwKw7YuT8KOT09fPsOvH8K+eMOcw68tcsK/DsKiAsKywr3CvcOeCCQ4LcKCwrInw7rClnAnwrzDq8OVXm/CkgYIIMKFwpxpEsKFwqYtwrM0wpnDtR7DhUUUw53DrTXCpsKAwpkCOCTCo8KuFB7Ds8KFwpTCrsOjUMKfCyPDjzhTw6PDucOpbSVfTcObZkLDksO1eD8ew7VLPMKAWcKUIGjDoyDDisOCwr3Dnk3CoGLDm8OhwoPDk8Ozw4cnPcKTZMKrU8Oow6ZNMgrCo2PClAdhAkQ0U8OxZBzDhhNowpFrKFB0wo3DoyzDiVTCrsKSGMKKAsKRwqohw6oKZcKQwpPCmzvDtMO/w7TDosO4AsOuwpDCv8Ovwo/Dh8OhMMOXwprDl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